<!-- extend from base layout -->
{% extends "base.html" %}
 
{% block content %}
	<link rel="stylesheet" type="text/css" href="http://v3.bootcss.com/examples/dashboard/dashboard.css">
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">学生上机管理系统</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav navbar-right">
            <li><a href="#">Name</a></li>
            <li><a href="/logout">Logout</a></li>
          </ul>
          <form class="navbar-form navbar-right">
            <input type="text" class="form-control" placeholder="Search...">
          </form>
        </div>
      </div>
    </nav>

    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
          <ul class="nav nav-sidebar">
            <li><a href="/admin/stuinfo">学生管理</span></a></li>
          </ul>
          <ul class="nav nav-sidebar">
          	<li><a href="/admin/reservation">预约管理</a></li>
          </ul>
          <ul class="nav nav-sidebar">
            <li><a href="/admin/computer">机器管理</a></li>
          </ul>
          <ul class="nav nav-sidebar">
            <li><a href="/admin/statistics">上机统计</a></li>
          </ul>
          <ul class="nav nav-sidebar">
            <li class="active"><a href="/admin/admin">管理员管理</a></li>
          </ul>
          <ul class="nav nav-sidebar">
            <li><a href="/admin/log">显示日志</a></li>
          </ul>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
          <h2 class="sub-header">管理员列表<a href="/admin/admin/add" class="btn btn-success">+</a></h2>
          {% with messages = get_flashed_messages() %}
          {% if messages|length > 0%}
          <div class="alert alert-info" role="alert">
            {{messages[-1]}}
          </div>
          {% endif %}
          {% endwith %}
          <div class="table-responsive">
            <table class="table table-striped">
              <thead>
                <tr>
                  <th>管理员ID</th>
                  <th>姓名</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
              {%for admin in admins%}
                <tr>
                  <td>{{admin.AdminID}}</td>
                  <td>{{admin.Name}}</td>
                  <td>
                    <a href="/admin/admin/alter?id={{admin.AdminID}}" class="btn btn-primary btn-xs">修改</a>
                    <a href="/admin/admin/delete?id={{admin.AdminID}}" class="btn btn-danger btn-xs">删除</a>
                  </td>
                </tr>
              {%endfor%}
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <script src="http://v3.bootcss.com/dist/js/bootstrap.min.js"></script>
    <!-- Just to make our placeholder images work. Don't actually copy the next line! -->
    <script src="http://v3.bootcss.com/assets/js/vendor/holder.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="http://v3.bootcss.com/assets/js/ie10-viewport-bug-workaround.js"></script>
{% endblock %}